package com.redisdemo;
import redis.clients.jedis.Jedis;
import java.util.*;
//mvn exec:java -Dexec.mainClass="com.redisdemo.RedisKeyJava" -Dexec.cleanupDaemonThreads=false
public class RedisKeyJava {
    public static void main(String[] args) {
        //Jedis jedis = new Jedis("localhost");
        Jedis jedis = JedisUtil.getPool().getResource();
        System.out.println("Connection to server sucessfully");
        Set<String> keys = jedis.keys("*");
        Iterator t1 = keys.iterator();
        while (t1.hasNext()) {
            Object obj1 = t1.next();
            System.out.println(obj1);
        }
        JedisUtil.getPool().returnResource(jedis);
    }
}
